<? if(!defined('IN_ROOT')) exit('Access Denied'); ?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd"><? $user=$this->user; $setting=$this->setting; ?><html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Manyou's Control Panel</title>
<meta http-equiv="Content-Type" content="text/html; charset=<?=MY_CHARSET?>">
<link media="all" type="text/css" href="css/common/admin/admincp.css" rel="stylesheet"/>
<script src="js/jquery.js" type="text/javascript"></script>
<script src="js/jqueryui.js" type="text/javascript"></script>
<script src="js/admin.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function() {
$("#list").sortable({
update: function(){
var reorderid="";
var numValue=$("input[name='order[]']");
for(var i=0;i<numValue.length;i++){
reorderid+=$(numValue[i]).val()+",";
}
var hiddencid=$("input[name='hiddencid']").val();
$.post("index.php?admin_area/reorder<?=$setting['seo_suffix']?>",{order:reorderid,hiddencid:hiddencid});
}
});
});
</script>
</head>
<body>

<div class="container"><? if(isset($message)) { $type=isset($type)?$type:'correctmsg';  ?><div class="<?=$type?>"><p><?=$message?></p></div><? } ?><h3 class="marginbot">地区列表<a class="sgbtn" href="index.php?admin_area/add/new<?=$setting['seo_suffix']?>">添加新地区</a></h3>
<div id="path"><a href="index.php?admin_area/default<?=$setting['seo_suffix']?>">根目录</a><? if(isset($navlist)) { if(is_array($navlist)) { foreach($navlist as $nav) { ?>
 &gt;&gt; <a href="index.php?admin_area/view/<?=$nav['id']?><?=$setting['seo_suffix']?>"><?=$nav['name']?></a>  
 
<? } } } ?> <? if(isset($area['name'])) { ?>&gt;&gt; <?=$area['name']?><? } ?></div>
<div class="note fixwidthdec">
<p class="i">地区的排序可以通过鼠标拖动来改变，当鼠标在某一地区上面时，按住左键即可上下移动。</p>
</div>
<div class="mainbox">
<form name="answerlist" onsubmit="return confirm('删除该地区会同时删除该地区下的子地区及其地区下的所有问题，确定继续?');" action="index.php?admin_area/remove<?=$setting['seo_suffix']?>" method="post">
<table width="80%" cellspacing="0" cellpadding="3" class="list">
<tr align="center" class="list_title">
<th width="15%" align="left"><input class="checkbox" id="chkall" onclick="checkall('cid[]')" type="checkbox" name="chkall"><label for="chkall">全选</label></th>					
<th width="30%" align="center"><strong>地区名称</strong></th><? if(2>$area['grade']) { ?><th  width="20%" align="center"><strong>查看子地区</strong></th>
<th  width="20%" align="center"><strong>添加子地区</strong></th><? } ?><th  width="15%" align="center"><strong>编辑</strong></th>
</tr>    
</table>
    <input type="hidden" name="hiddencid" value="<?=$pid?>" />
<ul id="list" style="cursor: hand; cursor: pointer;" >
<? if(is_array($arealist)) { foreach($arealist as $cate) { ?>
<li style="list-style:none;">
<table width="80%"  class="list" id="table1">
<tr style="background:#f7f7f7">
<td width="15%"><input class="checkbox" type="checkbox" value="<?=$cate['id']?>" name="cid[]"></td>
<td width="30%" ><a href="index.php?admin_area/view/<?=$cate['id']?><?=$setting['seo_suffix']?>"><input name="order[]" type="hidden" value="<?=$cate['id']?>"/><strong><?=$cate['name']?></strong></a></td>

<td width="20%" align="center"><a href="index.php?admin_area/view/<?=$cate['id']?><?=$setting['seo_suffix']?>"><img src="<?=SITE_URL?>css/common/admin/view.png"></a></td>
<td width="20%" align="center"><a href="index.php?admin_area/add/<?=$cate['id']?>/<?=$cate['pid']?><?=$setting['seo_suffix']?>"><img src="<?=SITE_URL?>css/common/admin/add.png"></a></td>

<td width="15%" align="center"><a href="index.php?admin_area/edit/<?=$cate['id']?><?=$setting['seo_suffix']?>"><img src="<?=SITE_URL?>css/common/admin/edit.png"></a></td>
</tr>
</table>
</li>
<? } } ?>
</ul>
<table width="80%" cellspacing="0" cellpadding="3">
<tr class="nobg"><td><input class="btn" type="submit" name="submit" value="删&nbsp;除" /></td></tr>
</table>
</form>
</div>
</div>
</body>
</html>